package com.nick.sscplan.util;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import android.text.format.Time;

public class SscUtils {

    public static final String SSC_ID = "_id";
    public static final String SSC_ISSUE = "issue";;
    public static final String SSC_DATA1 = "data1";
    public static final String SSC_DATA2 = "data2";
    public static final String SSC_DATA3 = "data3";
    public static final String SSC_DATA4 = "data4";
    public static final String SSC_DATA5 = "data5";
    public static final String SSC_OPENTIME = "opentime";
    public static final String SSC_REMARK = "remark";

    private static final String SSC_BASE_URL = "http://www.500wan.com/static/public/ssc/xml/qihaoxml/";

    // get system time
    public static String getSystemDate() {
        String date = "";
        // SimpleDateFormat dateFormatter = new
        // SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyyMMdd");
        Date curDate = new Date(System.currentTimeMillis());
        date = dateFormatter.format(curDate);
        return date;
    }

    public static String getHistoryUrl(int date) {
        Time time = new Time();
        int day = time.monthDay;
        String url = "";
        return url;
    }

    public static String getUrl() {
        String url = "";
        String date = getSystemDate();
        url = SSC_BASE_URL + date + ".xml";
        return url;
    }
    
    public static List<String> getHistoryDate(){
         List<String> lists = new ArrayList<String>();
         SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-M-d");
         Calendar cal = Calendar.getInstance();
         String date1 = dateFormatter.format(cal.getTime());
         cal.add(Calendar.DATE, -1);
         String date2 = dateFormatter.format(cal.getTime());
         cal.add(Calendar.DATE, -1);
         String date3 = dateFormatter.format(cal.getTime());
         
         lists.add(date1);
         lists.add(date2);
         lists.add(date3);
         
         
         return lists;
    }
    
}
